<template funtional>
  <el-select v-model="currentValue" clearable :allow-create="addtype" :filterable="addtype" placeholder="请选择">
    <el-option v-for="item of lists" :key="item.id" :label="item.value" :value="item.id" />
  </el-select>
</template>

<script>
export default {
  props: {
    value: {
      required: true
    },
    lists: {
      required: true
    },
    addtype: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    currentValue: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }
  }
}
</script>
